<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context.xsd">

  <!-- <mvc:annotation-driven/> -->
  <context:component-scan base-package="org.geoserver.backuprestore.rest"/>

</beans>

  <!-- bean class="org.geoserver.platform.ModuleStatusImpl">
    <constructor-arg index="0" value="gs-backup-restore-rest,"/>
    <constructor-arg index="1" value="Backup Rstore REST"/>
  </bean>
  
  <bean id="backupResource" class="org.geoserver.backuprestore.rest.BackupResource" scope="prototype">
    <constructor-arg ref="backupFacade"/>
  </bean>
  <bean id="backupContextFinder" class="org.geoserver.backuprestore.rest.BackupResourceFinder">
      <constructor-arg value="backupResource"/>
  </bean>

  <bean id="restoreResource" class="org.geoserver.backuprestore.rest.RestoreResource" scope="prototype">
    <constructor-arg ref="backupFacade"/>
  </bean>
  <bean id="restoreContextFinder" class="org.geoserver.backuprestore.rest.RestoreResourceFinder">
      <constructor-arg value="restoreResource"/>
  </bean>
  
  <bean id="backupRestoreRestMapping" class="org.geoserver.rest.RESTMapping">
    <property name="routes">
      <map>
        <entry>
          <key>
            <value>/br/backup</value>
          </key>
          <value>backupContextFinder</value>
        </entry>
        <entry>
          <key>
            <value>/br/backup/{backupId}.{format}</value>
          </key>
          <value>backupContextFinder</value>
        </entry>
        <entry>
          <key>
            <value>/br/restore</value>
          </key>
          <value>restoreContextFinder</value>
        </entry>
        <entry>
          <key>
            <value>/br/restore/{restoreId}.{format}</value>
          </key>
          <value>restoreContextFinder</value>
        </entry>
      </map>
    </property>
  </bean -->
